package user

import (
	"github.com/google/wire"
	v1 "jmicro/api/user/v1"
	srv1 "jmicro/app/user/srv/internal/service/v1"
)

var ProviderSet = wire.NewSet(NewUserServer)

type userServer struct {
	v1.UnimplementedUserServer
	srv srv1.UserSrv
}

// java中的ioc，AutoWire，控制反转(ioc,ioc=injection of control)
// 代码分层，第三方服务(rpc,redis)各种服务，可以使用控制反转   带来了一定的复杂度
func NewUserServer(srv srv1.UserSrv) v1.UserServer {
	return &userServer{srv: srv}
}

//func NewUserServer(srv srv1.UserSrv) *userServer {
//	return &userServer{srv: srv}
//}
